package com.ruoyi.mall.cms.service.impl;

import com.ruoyi.mall.cms.domain.CmsSubjectCategory;
import com.ruoyi.mall.cms.mapper.CmsSubjectCategoryMapper;
import com.ruoyi.mall.cms.service.ICmsSubjectCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专题分类Service业务层处理
 *
 * @author xuxing
 * @date 2021-02-05
 */
@Service
public class CmsSubjectCategoryServiceImpl implements ICmsSubjectCategoryService
{
    @Autowired
    private CmsSubjectCategoryMapper cmsSubjectCategoryMapper;

    /**
     * 查询专题分类
     *
     * @param id 专题分类ID
     * @return 专题分类
     */
    @Override
    public CmsSubjectCategory selectCmsSubjectCategoryById(Long id)
    {
        return cmsSubjectCategoryMapper.selectCmsSubjectCategoryById(id);
    }

    /**
     * 查询专题分类列表
     *
     * @param cmsSubjectCategory 专题分类
     * @return 专题分类
     */
    @Override
    public List<CmsSubjectCategory> selectCmsSubjectCategoryList(CmsSubjectCategory cmsSubjectCategory)
    {
        return cmsSubjectCategoryMapper.selectCmsSubjectCategoryList(cmsSubjectCategory);
    }

    /**
     * 新增专题分类
     *
     * @param cmsSubjectCategory 专题分类
     * @return 结果
     */
    @Override
    public int insertCmsSubjectCategory(CmsSubjectCategory cmsSubjectCategory)
    {
        return cmsSubjectCategoryMapper.insertCmsSubjectCategory(cmsSubjectCategory);
    }

    /**
     * 修改专题分类
     *
     * @param cmsSubjectCategory 专题分类
     * @return 结果
     */
    @Override
    public int updateCmsSubjectCategory(CmsSubjectCategory cmsSubjectCategory)
    {
        return cmsSubjectCategoryMapper.updateCmsSubjectCategory(cmsSubjectCategory);
    }

    /**
     * 批量删除专题分类
     *
     * @param ids 需要删除的专题分类ID
     * @return 结果
     */
    @Override
    public int deleteCmsSubjectCategoryByIds(Long[] ids)
    {
        return cmsSubjectCategoryMapper.deleteCmsSubjectCategoryByIds(ids);
    }

    /**
     * 删除专题分类信息
     *
     * @param id 专题分类ID
     * @return 结果
     */
    @Override
    public int deleteCmsSubjectCategoryById(Long id)
    {
        return cmsSubjectCategoryMapper.deleteCmsSubjectCategoryById(id);
    }
}
